package entidades;

import java.io.Serializable;
import javax.persistence.*;
import java.util.List;


/**
 * The persistent class for the tarjeta database table.
 * 
 */
@Entity
@Table(name="tarjeta")
public class Tarjeta implements Serializable {
	private static final long serialVersionUID = 1L;

	@Id
	private String id;

	private int puntos;

	private double saldo;

	//bi-directional many-to-one association to Recarga
	@OneToMany(mappedBy="tarjetaBean", fetch=FetchType.EAGER)
	private List<Recarga> recargas;

	//bi-directional many-to-one association to Cliente
    @ManyToOne
	@JoinColumn(name="cliente")
	private Cliente clienteBean;

	//bi-directional many-to-many association to Transaccion
	@ManyToMany(fetch=FetchType.EAGER)
	@JoinTable(
		name="transaccionestarjeta"
		, joinColumns={
			@JoinColumn(name="tarjeta")
			}
		, inverseJoinColumns={
			@JoinColumn(name="transaccion")
			}
		)
	private List<Transaccion> transaccions;

    public Tarjeta() {
    }

	public String getId() {
		return this.id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public int getPuntos() {
		return this.puntos;
	}

	public void setPuntos(int puntos) {
		this.puntos = puntos;
	}

	public double getSaldo() {
		return this.saldo;
	}

	public void setSaldo(double saldo) {
		this.saldo = saldo;
	}

	public List<Recarga> getRecargas() {
		return this.recargas;
	}

	public void setRecargas(List<Recarga> recargas) {
		this.recargas = recargas;
	}
	
	public Cliente getClienteBean() {
		return this.clienteBean;
	}

	public void setClienteBean(Cliente clienteBean) {
		this.clienteBean = clienteBean;
	}
	
	public List<Transaccion> getTransaccions() {
		return this.transaccions;
	}

	public void setTransaccions(List<Transaccion> transaccions) {
		this.transaccions = transaccions;
	}
	
}